import { RouterView } from 'vue-router'

const routes = {
  path: '/goods',
  name: 'Goods',
  component: RouterView,
  meta: { title: '商品', requiresAuth: true },
  children: [
    {
      path: '',
      name: 'goods_list',
      component: () => import('@/views/goods/goodsList.vue'),
      meta: { title: '商品列表' }
    },
    {
      path: 'add',
      name: 'add_goods',
      component: () => import('@/views/goods/addOrEditGoods.vue'),
      meta: { title: '添加商品' }
    },
    {
      path: 'edit/:id',
      name: 'edit_goods',
      component: () => import('@/views/goods/addOrEditGoods.vue'),
      meta: { title: '编辑商品' }
    }
  ]
}

export default routes